/*
 * Timer.h
 *
 *  Created on: 2011-3-18
 *      Author: chenl
 */

#ifndef TIMER_H_
#define TIMER_H_

#include "common/common_type.h"
#include "datetime/datetime.h"

typedef struct tagTimer
{
	int 		enmTimerType;
	int 		nOwnerID;
	int64_t 	nStartTime;
	int64_t 	nEndTime;
	int64_t 	nCycleTime;
	bool 		bIsTimerCycle;
	uint32_t 	nAttData0;
	uint32_t 	nAttData1;
	int 		nFireCount;
}Timer;

inline bool IsTimerFire(const Timer& timer)
{
	return timer.nEndTime > CDateTime::CurrentDateTime().uSeconds() ? false : true;
}

#endif /* TIMER_H_ */
